<%@page contentType="text/html" %>
<%@page pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <title>登录页</title>
    <%@include file="WEB-INF/jsp/common/head.jsp" %>
</head>
<body>
<div class="container"
     style="background-repeat: no-repeat;background-image: url(${pageContext.request.contextPath}/statics/img/login.jpg);">
    <div class="row">
        <h1 style="text-align: center;color: white;">医院挂号管理系统</h1>
    </div>
    <div class="row" style="height: 800px;">
        <div class="col-md-4 col-md-offset-8">
            <h1 style="color:white;" class="text-center">信息管理</h1>
            <!-- Nav tabs -->
            <ul class="nav nav-tabs" role="tablist">
                <li role="presentation" class="active"><a href="#home" aria-controls="home" role="tab" data-toggle="tab"
                                                          style="color: darkblue;">医生登录</a></li>
                <li role="presentation">
                    <a href="#profile" aria-controls="profile" role="tab" data-toggle="tab" style="color: darkblue;">管理员登录</a>
                </li>
            </ul>
            <!-- Tab panes -->
            <div class="tab-content">
                <div role="tabpanel " class="tab-pane active " id="home" style="background-color: white;height: 250px;">
                    <form class="form-horizontal" method="post" action="${pageContext.request.contextPath}/admin/logindoctor">
                        <div class="form-group">
                            <div class="col-sm-10 col-sm-offset-1 col-xs-10 col-xs-offset-1" style="margin-top: 10px;">
                                <input type="text" name="dId" class="form-control" id="doctorId"
                                       placeholder="用户账号" style="width: 95%;float: left;">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-10 col-sm-offset-1 col-xs-10 col-xs-offset-1">
                                <input type="password" name="dPassword" class="form-control" id="dPassword"
                                       placeholder="密码" style="width: 95%;float: left;">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-10 col-sm-offset-1 col-xs-10 col-xs-offset-1">
                                <div class="checkbox">
                                    <label>
                                        <input type="checkbox"> 记住我
                                    </label>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-offset-2 col-sm-10 col-xs-10 col-xs-offset-1">
                                <button type="submit" class="btn btn-default" style="width: 100px;margin-right: 10%;"
                                        id="login1">登录
                                </button>
                            </div>
                        </div>
                    </form>
                </div>

                <div role="tabpanel" class="tab-pane" id="profile" style="background-color: white;height: 250px;">
                    <form class="form-horizontal" action="${pageContext.request.contextPath}/admin/login" method="post">
                        <div class="form-group">
                            <div class="col-sm-10 col-sm-offset-1 col-xs-10 col-xs-offset-1" style="margin-top: 10px;">
                                <input type="text" name="AdName" class="form-control" id="usernName2"
                                       placeholder="管理员账号" style="width: 95%;float: left;">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-10 col-sm-offset-1 col-xs-10 col-xs-offset-1">
                                <input type="password" name="passWord" class="form-control" id="passWrod2"
                                       placeholder="密码" style="width: 95%;float: left;">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-10 col-sm-offset-1 col-xs-10 col-xs-offset-1">
                                <div class="checkbox">
                                    <label>
                                        <input type="checkbox"> 记住我
                                    </label>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-offset-2 col-sm-10 col-xs-10 col-xs-offset-1">
                                <button type="submit" class="btn btn-default" style="width: 200px;" id="login2">登录
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

</body>
<!-- jQuery文件。务必在bootstrap.min.js 之前引入  -->
<script src="${pageContext.request.contextPath}/statics/lib/jquery/1.9.1/jquery.min.js"></script>
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="${pageContext.request.contextPath}/statics/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/statics/js/index.js" type="text/javascript"></script>
<script type="text/javascript">

    $(function () {
        var flag = ${loginState == null};
        if (!flag) {
            var count = ${loginState};
            if(count == 0) {
                alert("账号或者密码错误，请重试");
            } else if(count == -1) {
                alert("账号已停用！");
            }
        }
    })
</script>
</html>
